from django.contrib import admin
from .models import *


class AncientPoetryProfile(admin.ModelAdmin):
    list_display = ['title', 'category', 'author', 'dynasty', 'content']  # 展示所有数据
    list_per_page = 10
    search_fields = ['title', 'author', ]
    list_filter = ['category', 'dynasty']


class AncientBooksProfile(admin.ModelAdmin):
    list_display = ['id', 'title', 'introduce']  # 展示所有数据
    list_per_page = 10
    search_fields = ['title']


admin.site.register(AncientPoetry, AncientPoetryProfile)
admin.site.register(AncientBooks, AncientBooksProfile)
